FROM django

MAINTAINER Glittering <zhaoshichengzhao@sina.com>

RUN rm /etc/apt/sources.list && rm -rf ~/.pip

ADD ./sources.list /etc/apt/
ADD ./DjangoUeditor.tar.gz /tmp
ADD ./requirements /tmp

RUN apt update && \
    apt full-upgrade -y --force-yes && \
    apt install supervisor -y --force-yes

WORKDIR /tmp
RUN pip install uwsgi pip --upgrade django --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple/ && \
    pip install -r requirements -i https://pypi.tuna.tsinghua.edu.cn/simple/

WORKDIR /tmp/DjangoUeditor 
RUN python3 setup.py install 

WORKDIR /
RUN mkdir /data && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/*

CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]

